cmake_minimum_required(VERSION 3.18.1)

# Declares and names the project.

project("qisda")

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 包含 nlohmann/json 和 Protobuf 的头文件路径
#include_directories(${CMAKE_SOURCE_DIR}/cpp)
#include_directories(${CMAKE_SOURCE_DIR}/cpp/include)
include_directories(E:/include)
#include_directories(E:/include/protobuf-cpp-3.17.3/protobuf-3.17.3/src)
include_directories(E:/protobuf-3.17.3/src)

# 添加 Protobuf 静态库路径
link_directories(E:/protobuf-3.17.3/cmake/build)

# 源文件
add_library(
        qisda
        SHARED
        Workout_new.pb.cc
        WorkoutDataHandler.cpp
        BikeCommandUtil.cpp
        CalMetricDataUtil.cpp
        CommandConstants.cpp
        native-lib.cpp
)

# 链接 Protobuf 库
target_link_libraries(qisda libprotobuf.a libprotoc.a)


find_library(
        log-lib
        log)

target_link_libraries(
        qisda
        ${log-lib})